class User {
  late bool admin;
  late List<dynamic> chapterTops;
  late List<dynamic> collectIds;
  late String email;
  late String icon;
  late int id;
  late String nickname;
  late String password;
  late String token;
  late int type;
  late String username;

  static User? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    User user = User();
    user.admin = map["admin"];
    user.chapterTops = map["chapterTops"];
    user.collectIds = map["collectIds"];
    user.email = map["email"];
    user.icon = map["icon"];
    user.id = map["id"];
    user.nickname = map["nickname"];
    user.password = map["password"];
    user.token = map["token"];
    user.type = map["type"];
    user.username = map["username"];
    return user;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['admin'] = admin;
    data['chapterTops'] = chapterTops;
    data['collectIds'] = collectIds;
    data['email'] = email;
    data['icon'] = icon;
    data['id'] = id;
    data['nickname'] = nickname;
    data['password'] = password;
    data['token'] = token;
    data['type'] = type;
    data['username'] = username;
    return data;
  }
}
